﻿using System;
using System.Collections.Generic;

namespace Utility
{
	// Token: 0x02000403 RID: 1027
	public abstract class StateManagerBase_WithMsg<T_ID, T_CLASS, T_MSG> where T_CLASS : StateBase_WithMsg<T_MSG>
	{
		// Token: 0x06001996 RID: 6550 RVA: 0x000A50D0 File Offset: 0x000A32D0
		public StateManagerBase_WithMsg()
		{
		}

		// Token: 0x17000273 RID: 627
		// (get) Token: 0x06001997 RID: 6551 RVA: 0x000A50E4 File Offset: 0x000A32E4
		public T_ID NowStateID
		{
			get
			{
				return this.nowStateID;
			}
		}

		// Token: 0x17000274 RID: 628
		// (get) Token: 0x06001998 RID: 6552 RVA: 0x000A50EC File Offset: 0x000A32EC
		public T_ID PrevStateID
		{
			get
			{
				return this.prevStateID;
			}
		}

		// Token: 0x06001999 RID: 6553 RVA: 0x000A50F4 File Offset: 0x000A32F4
		public void Main()
		{
			this.nowStateClass.Main();
		}

		// Token: 0x0600199A RID: 6554 RVA: 0x000A5108 File Offset: 0x000A3308
		public void SetState(T_ID t_id, T_CLASS t_class)
		{
			this.states.Add(t_id, t_class);
		}

		// Token: 0x0600199B RID: 6555 RVA: 0x000A5118 File Offset: 0x000A3318
		public void ChangeState(T_ID next, T_MSG msg)
		{
			if (this.nowStateClass != null)
			{
				this.nowStateClass.Out();
			}
			this.prevStateID = this.nowStateID;
			this.nowStateID = next;
			this.nowStateClass = this.states[this.nowStateID];
			this.nowStateClass.In(msg);
		}

		// Token: 0x04001CC2 RID: 7362
		protected Dictionary<T_ID, T_CLASS> states = new Dictionary<T_ID, T_CLASS>();

		// Token: 0x04001CC3 RID: 7363
		protected T_ID nowStateID;

		// Token: 0x04001CC4 RID: 7364
		protected T_ID prevStateID;

		// Token: 0x04001CC5 RID: 7365
		protected T_CLASS nowStateClass;
	}
}
